import React, { Component } from 'react';
import Taro from '@tarojs/taro';
import {View} from '@tarojs/components'
import {getPageParams} from "../../utils/tools";
import {TARO_ENV} from "../../constants/api";

export default class Jump extends Component {

  async UNSAFE_componentWillMount() {
    if (TARO_ENV === 'h5') {
      await Taro.redirectTo({
        url: '/common/label/label' + getPageParams() + '&category=2'
      });
    }
  }

  async componentDidShow() {
    if (TARO_ENV === 'weapp' || TARO_ENV === 'tt') {
      await Taro.redirectTo({
        url: '/common/label/label' + getPageParams() + '&category=2'
      });
    }
  }

  render() {
    return (
      <View />
    )
  }
}
